package com.taskcollection.util;

import org.apache.commons.collections.Factory;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by Administrator on 2016/8/13 0013.
 */
public class SpringUtil {
    private static SpringUtil springUtil;
    ApplicationContext applicationContext;
    private SpringUtil(){
        applicationContext = new ClassPathXmlApplicationContext("spring.xml");
    }
    public static SpringUtil getinstance(){
        if(springUtil==null){
            springUtil = new SpringUtil();
        }
        return springUtil;
    }
    public BeanFactory getFactory(){
        return applicationContext;
    }
}
